package koby99.swing.outline;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.BorderLayout;
import java.awt.Image;

import javax.swing.JButton;
import java.awt.Dialog.ModalityType;
import javax.swing.JPanel;
import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage;

public class J26_SunjukAboutDialog extends JDialog{
	
	public J26_SunjukAboutDialog(JFrame p) {
		setSize(450,300);
		setModal(true);
		setTitle("프로젝트 정보");
		
		JPanel Westp = new JPanel();
		getContentPane().add(Westp, BorderLayout.WEST);
		Westp.setLayout(new BoxLayout(Westp, BoxLayout.X_AXIS));
		
		
		BufferedImage img = null;
		try{img = ImageIO.read(getClass().getResource("/images/sajin.jpg"));
		
		}catch (Exception e) {
			e.printStackTrace();
		}
		
		Image resizeimg = img.getScaledInstance(300, 150,Image.SCALE_SMOOTH);
		Westp.add( new ImageIcon( resizeimg ) );
		 setVisible( true);
		
		
		JPanel Eastp = new JPanel();
		getContentPane().add(Eastp, BorderLayout.EAST);
		Eastp.setLayout(new BoxLayout(Eastp, BoxLayout.X_AXIS));
		
		JLabel introlbl = new JLabel("브라라라라라ㅏ");
		Eastp.add(introlbl);
		
		JPanel Southp = new JPanel();
		getContentPane().add(Southp, BorderLayout.SOUTH);
		
		JButton okbtn = new JButton("확인");
		okbtn.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				// System.exit(0); 이러면 시스템이 꺼지니 안되
				setVisible(false);
				dispose();
			}
		});
		Southp.add(okbtn);
		setVisible(true);
	
	}
	
}
